package com.ck.ck_back.controller;

import com.ck.ck_back.pojo.Result;
import com.ck.ck_back.service.manage;
import com.ck.ck_back.service.msgservice;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/manage")
@RestController
public class mangeController {
    @Resource
    private manage manageimpl;

    @PostMapping("/login")
    public Object login(String username,String pwd){
        int result = manageimpl.login(username,pwd);
        if (result == 1){
            return Result.success(result);
        }else if (result == 2){
            return Result.failure("登陆失败");
        }else {
            return Result.failure("参数错误");
        }
    }
}
